package com.kechen.client.pojo;

import com.kechen.client.fegin.Myfegin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Author 0xHertz
 * @Date: 2022/11/7 0007 16:30
 * @Description: 第二种方式进行Fallback
 **/
@Component
public class MyFallBackFactory implements FallbackFactory<Myfegin> {

    @Autowired
    private MyFallBack myFallBack;
    @Override
    public Myfegin create(Throwable throwable) {
        throwable.printStackTrace();
        return myFallBack;
    }
}
